import 'package:flutter/material.dart';
import 'src/pages/home_page.dart';
import 'package:provider/provider.dart';
import 'package:flutter_learner/src/providers/CounterBloc.dart';
import 'package:flutter_learner/src/providers/ThemeDataBloc.dart';
import 'package:flutter_learner/src/providers/WeatherInfo.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider<WeatherInfo>.value(value: WeatherInfo()),
        Provider<CounterBloc>.value(value: CounterBloc()),
        Provider<ThemeDataBloc>.value(value: ThemeDataBloc()),
      ],
      child: MaterialApp(
        title: 'Flutter学习者',
        theme: ThemeData(
          buttonTheme: ButtonThemeData(
            buttonColor: Colors.blue,
            highlightColor: Colors.blue[700],
            splashColor: Colors.grey,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(20.0),
            ),
          )
        ),
        home: HomePage(),
      ),
    );
  }
}
